flowbox: Set accessible roles
authorMatthias Clasen <mclasen@redhat.com>
Thu, 15 Oct 2020 02:18:31 +0000 (22:18 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 15 Oct 2020 02:20:43 +0000 (22:20 -0400)
Use the GRID and GRID_CELL roles for GtkFlowBox
and GtkFlowBoxChild.

docs/reference/gtk/section-accessibility.md
gtk/gtkenums.h
gtk/gtkflowbox.c

index 01adae28988586cb422f8894fadcc5323aa7abb2..37309df83b254abb710f60664a1f22da48a879c9 100644 (file)
@@ -49,6 +49,8 @@ Each role name is part of the #GtkAccessibleRole enumeration.
 | `CHECKBOX` | A control that has three possible value: `true`, `false`, or `undefined` | #GtkCheckButton |
 | `COMBOBOX` | A control that can be expanded to show a list of possible values to select | #GtkComboBox |
 | `DIALOG` | A dialog that prompts the user to enter information or require a response | #GtkDialog and subclasses |
+| `GRID` | A grid of items | #GtkFlowBox |
+| `GRID_CELL` | An item in a grid | #GtkFlowBoxChild |
 | `IMG` | An image | #GtkImage, #GtkPicture |
 | `LABEL` | A visible name or caption for a user interface component | #GtkLabel |
 | `LIST` | A list of items | #GtkListBox |
index b33f29ba82c2f38f03d8bba21c5595cd29c2389a..4aa4b8b4e6f151924a0a3d05c81f50941c90fc2c 100644 (file)
@@ -1175,8 +1175,8 @@ typedef enum {
  * @GTK_ACCESSIBLE_ROLE_FEED: Unused
  * @GTK_ACCESSIBLE_ROLE_FORM: Unused
  * @GTK_ACCESSIBLE_ROLE_GENERIC: Unused
- * @GTK_ACCESSIBLE_ROLE_GRID: Unused
- * @GTK_ACCESSIBLE_ROLE_GRID_CELL: Unused
+ * @GTK_ACCESSIBLE_ROLE_GRID: A grid of items.
+ * @GTK_ACCESSIBLE_ROLE_GRID_CELL: An item in a grid.
  * @GTK_ACCESSIBLE_ROLE_GROUP: Unused
  * @GTK_ACCESSIBLE_ROLE_HEADING: Unused
  * @GTK_ACCESSIBLE_ROLE_IMG: An image.
index f7f60c9bcb3fef6b1a890d9479d04e7fe2b17eee..8d01400835bb81e07f957b7bb4a227383bf30534 100644 (file)
@@ -547,6 +547,7 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
 
   gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("flowboxchild"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL);
 }
 
 static void
@@ -3887,6 +3888,7 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
                                        NULL);
 
   gtk_widget_class_set_css_name (widget_class, I_("flowbox"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID);
 }
 
 static void